import request from '@/utils/request'
// import store from '@/store/index.js'

export function getDeptsListAPI() { // 定义查询部门列表的接口
  return request({
    method: 'get',
    url: '/company/department'
    // 模拟服务器状态不为200的错误
    // url: '/sys/login1111',

  })
}

export function addDeptsAPI(data) { // 定义查询部门列表的接口
  return request({
    method: 'post',
    url: '/company/department',
    data

  })
}
export function delDeptsAPI(id) { // 定义删除部门的接口
  return request({
    method: 'DELETE',
    url: '/company/department/' + id

  })
}
export function getDeptsByIdAPI(id) { // 定义恩局id查询部门的接口
  return request({
    method: 'get',
    url: '/company/department/' + id

  })
}

export function editDeptsByIdAPI(data) { // 定义根据id编辑部门的接口
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data

  })
}
